package com.sso.shiro;


import org.apache.shiro.cache.Cache;
import org.apache.shiro.cache.CacheException;
import org.apache.shiro.cache.CacheManager;
import org.springframework.data.redis.core.RedisTemplate;

import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class MyCacheManager implements CacheManager {

    private RedisTemplate<String,Object> redisTemplate;
    @Override
    public <K, V> Cache<K, V> getCache(String name) throws CacheException {
        return new MyValueCache<K,V>(name,redisTemplate);
    }

    public RedisTemplate<String, Object> getRedisTemplate() {
        return redisTemplate;
    }

    public void setRedisTemplate(RedisTemplate<String, Object> redisTemplate) {
        this.redisTemplate = redisTemplate;
    }
}
